﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows.Media;

namespace wpf.Triage.Convert
{
    public class NotNullBackGroundConvert : IValueConverter
    {
        /// <summary>
        /// 字符串转颜色显示  2022-03-28
        /// </summary>
        /// <param name="value"></param>
        /// <param name="targetType"></param>
        /// <param name="parameter"></param>
        /// <param name="culture"></param>
        /// <returns></returns>
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            Color col = Color.FromRgb(245, 245, 245);

            //患者PVid
            if (!string.IsNullOrEmpty(System.Convert.ToString(value)))
            {
                col = Color.FromRgb(255, 226, 227);

            }
           
            SolidColorBrush brush = new SolidColorBrush(col);
            return brush;
        }
        /// <summary>
        /// 实现接口  2022-03-28
        /// </summary>
        /// <param name="value"></param>
        /// <param name="targetType"></param>
        /// <param name="parameter"></param>
        /// <param name="culture"></param>
        /// <returns></returns>
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return string.Empty;
        }
    }
}
